
#ifndef BSYSDEFS_H_
#define BSYSDEFS_H_
#include "BUtils.h"

using namespace std;
typedef unsigned int UInt;
#ifndef EPOLLRDHUP
#define EPOLLRDHUP							0x2000
#endif
#define EPOLL_SVR_EVENT_FLAGS			EPOLLET | EPOLLPRI | EPOLLIN
#define EPOLL_CLI_EVENT_FLAGS			EPOLLET | EPOLLPRI | EPOLLIN | EPOLLRDHUP | EPOLLERR

#define GET_CURR_TIME(VAR,RETVAL,RETMICRO)	gettimeofday(&VAR,NULL); RETMICRO = VAR.tv_usec ; RETVAL = VAR.tv_sec * 1000 + RETMICRO / 1000;

#define MAX_MAX_CLIENT_COUNT 	65000
#define MAX_ARRAY_SIZE 		 	1024
#define MAX_TIMERS_LIMIT		128
#define MAX_TIMERS_INCREASE_INTERVAL		128
#define MAX_PULSE_TIMEOUT		30

#define MAX_EPOL_EVENTS			128
#define MAX_EPOL_WAIT	 		5
#define UNKNOWN_IP_ADDRESS	"Unknown IP"
#define CLI_READ_SIZE 4096

enum E_B_TYPES
{
#ifndef _E_EVT_CLIENT_
#define _E_EVT_CLIENT_
	E_EVT_CLIENT = 0,
#endif
#ifndef _E_EVT_SERVER_
#define _E_EVT_SERVER_
	E_EVT_SERVER,
#endif
#ifndef _E_EVT_TIMER_
#define _E_EVT_TIMER_
	E_EVT_TIMER,
#endif

#ifndef _E_EVT_TYPES_COUNT_
#define _E_EVT_TYPES_COUNT_
	E_EVT_TYPES_COUNT
#endif
};

class BItem
{
public:
	BItem(E_B_TYPES _etEType)
	{
		et_EType = _etEType;
	}
	virtual ~BItem(){};
	inline E_B_TYPES getEvtType(){return et_EType ; };

	bool b_IsDataLoggingEnabled;

private:
	E_B_TYPES et_EType;
};

typedef unsigned int UInt;
#define  MAX_IP_ADDRESS_LEN 64

#endif /* EVTDEFS_H_ */
